package com.demo.configclient.Controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author by admin, Email xx@xx.com, Date on 2020/6/5.
 * PS: Not easy to write code, please indicate.
 */
@RestController
@RefreshScope  //刷新配置
public class configController {
    @Value("${spring.application.name}")
    private String configname;

    @GetMapping("/getconfigname")
    public String getConfigname(){
        System.out.println("123123123");
        return configname;
    }
}
